import { View } from '@tarojs/components';
import s from './index.module.scss'

interface ButtonProps {
  text?: string,
  onClick?: any,
  state?: boolean,
  className?: string,
}

export default function Button(props: ButtonProps) {
  const { text, onClick, state = false, className = ''} = props
  return(
    //按钮 
    <View className={`${s.btn} ${className}`} onClick={onClick}>
      <View className={s.button}>
        <View className={s.line}></View>
        <View className={state ? `${s.circle} ${s.active}` : s.circle}></View>
      </View>
      <View className={s.text}>{text}</View>
    </View>
  )
}